<template>
  <div class="video-com">
    <video-player
      class="video-player-box"
      ref="videoPlayer"
      :options="playerOptions"
      :playsinline="true">
    </video-player>
  </div>
</template>

<script>
  import 'video.js/dist/video-js.css'
  import {videoPlayer} from 'vue-video-player'

  export default {
    props:['src'],
    computed: {},
    data() {
      return {
        playerOptions: {
          // videojs options
          language: 'en',
          //playbackRates: [0.7, 1.0, 1.5, 2.0],
          sources: [{
            type: "video/mp4",
            src: this.src
          }],
          poster: this.src,
          muted: true,
          controlBar: {
            timeDivider: true,
            durationDisplay: true,
            remainingTimeDisplay: false,
            fullscreenToggle: true  //全屏按钮
          }
        }
      }
    },
    components: {
      videoPlayer
    },
    computed: {

    },
    mounted() {

    },
    methods: {

    }
  }
</script>

<style lang="less" >
  @import "~assets/style/public";
  .video-js {
    width: 100% !important;
  }

  .video-js .vjs-big-play-button {
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
  }

</style>
